package net.csdra.wenhua.nanan.qiandao.service;

import net.csdra.wenhua.nanan.qiandao.domain.CheckIn;
import net.csdra.wenhua.nanan.qiandao.domain.Record;
import net.csdra.wenhua.nanan.qiandao.domain.User;
import org.springframework.data.domain.Page;

import java.sql.Date;
import java.sql.Timestamp;
import java.util.List;

/**
 * Created by xiaomi on 2017/2/20.
 */
public interface AdminService {

    boolean adminLogin(AdminLogin adminLogin);

    boolean deleteUserByUserId(String userId);

    boolean deleteCheckInByCheckInId(String checkInId);

    User getUserByWeixinId(String weixinId);

    Page<Record> getPagedRecord(GetPagedRecord getPagedRecord);

    List<CheckIn> getCheckInListAfter(String userId, Timestamp after);

    class AdminLogin {
        String username;
        String password;

        public String getUsername() {
            return username;
        }

        public void setUsername(String username) {
            this.username = username;
        }

        public String getPassword() {
            return password;
        }

        public void setPassword(String password) {
            this.password = password;
        }

        @Override
        public String toString() {
            return "AdminLogin{" +
                    "username='" + username + '\'' +
                    ", password='" + password + '\'' +
                    '}';
        }
    }

    class GetPagedRecord {
        /**
         * page >= 0
         */
        int page;
        int size;
        Date from;
        Date to;

        public int getPage() {
            return page;
        }

        public void setPage(int page) {
            this.page = page;
        }

        public int getSize() {
            return size;
        }

        public void setSize(int size) {
            this.size = size;
        }

        public Date getFrom() {
            return from;
        }

        public void setFrom(Date from) {
            this.from = from;
        }

        public Date getTo() {
            return to;
        }

        public void setTo(Date to) {
            this.to = to;
        }

        @Override
        public String toString() {
            return "GetPagedRecord{" +
                    "page=" + page +
                    ", size=" + size +
                    ", from=" + from +
                    ", to=" + to +
                    '}';
        }
    }
}
